#pragma once

#include <cmath>
#include <vector>

class Solution
{
public:
    int missingNumber(std::vector<int>&& nums)
    {
        int sum = nums.size() * (nums.size() + 1) / 2;
        for (auto n : nums)
            sum -= n;
        return sum;
    }
};
